Qanary components cannot access the question from the knowledge graph when they are run in Docker containers and the pipeline is started via localhost
.
The problem is that the Qanary pipeline carries localhost as an address in the Qanary message object, which is not accessible in the Docker container.
To solve this issue, we recommend adding an entry to the hosts file:
127.0.0.1 qanary-pipeline
Optionally you can add the components for an easiear development experience, run the following script:
npm install dotenv
node -r dotenv/config -e 'console.log(`\n`+Object.entries(process.env).filter(([key]) => key.match(/^(SPRING|RASA|ACTION|FRONTEND)(.*)NAME$/)).map(([, value]) => `127.0.0.1 ${value}`).join(`\n`));' >> ./hosts
sudo sh -c 'cat ./hosts >> /etc/hosts'
This script adds all components/services used in this project to the /etc/hosts
file.
With this change the Qanary pipeline can be reached at http://qanary-pipeline:40111 instead of localhost.